<template>
  <div class="MongolianLayer" v-if="props.isMongokuanLayer">
    <div class="close" @click="closeClick">
      <Icon type="close"></Icon>
    </div>
    <slot> </slot>
  </div>
</template>
<script setup>
import Icon from "../Icon/index.vue";
const props = defineProps({
  // 蒙层是否出现
  isMongokuanLayer:{
    type: Boolean,
    default:false
  }
})


const emit = defineEmits(['click'])
function closeClick(){
  emit('click',false)
}
</script>

<style lang="less" scoped>
@import "@/styles/var.less";
.MongolianLayer {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  overflow: auto;
  .close{
    color: @gray;
    position: absolute;
    right: 20px;
    top: 0;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    &:hover{
      background-color: @danger;
      color: @white;
    }
  }
}
</style>